package com.lk.model;

/**
 * Created by liu kun on 2018/7/24 0024.
 */

public class UserBiz implements IUserBiz {
    @Override
    public void login(final String name, final String password, final OnLoginListener listener) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                if ("刘备".equals(name)&&"0000".equals(password)){
                    User user=new User();
                    user.setName(name);
                    user.setPassword(password);
                    listener.loginSuccess(user);
                }else{
                    listener.loginFailed();
                }
            }
        }).start();
    }
}
